J.S. (JavaScript) Bach!

This script creates a mini-piano played with the mouse.

To use this recipe, your Netscape browser must be equipped with a WAV audio plugin, such as Beatnik. If you're seeing this page, we've already determined that you're okay and ready to go!

Discussion

The combination of images maps and JavaScript can produce powerful results for use in multimedia pages and applications. For Internet Explorer, we create an empty frame and rewrite it as necessary to generate the sound for a key; in Navigator/Communicator we can just address the audio player directly.

The base script for this recipe (JSBACH.HTM) also uses a trick to make sure that the 'invisible frame' necessary for MSIE isn't created if the browser is NN/NC. (What you see here is PIANOCD.HTM).

Copyright ©1998 by Charles River Media, All Rights Reserved